/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.fee.mapper;

import com.jeeplus.core.persistence.BaseMapper;
import com.jeeplus.core.persistence.annotation.MyBatisMapper;
import com.jeeplus.modules.fee.entity.DataCode;
import com.jeeplus.modules.fee.entity.FeeData;
import com.jeeplus.modules.fee.entity.Field;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 数据源字段名/表头DAO接口
 * @author cyf
 * @version 2016-11-22
 */
@MyBatisMapper
public interface DataCodeMapper extends BaseMapper<DataCode> {

	public List<FeeData> findListByfeeData(FeeData feeData);
	public List<Field> findListByfeeField(Field feeField);
	//根据数据源查询数据的表头
	public List<DataCode> findCodeByFeeDataId(String feeDataId);
	public List<DataCode> findBySource(String feeDataId);//根据数据源查询字段名
	public void updateFieldToCode(@Param(value = "feeDataCodeId") String feeDataCodeId, @Param(value = "feeFieldType") String feeFieldType,
                                  @Param(value = "feeFieldId") String feeFieldId);
	//查询数据源的表头字段的名称
	public List<String> findCodeNameBySource(@Param(value = "feeDataId") String feeDataId);
	//根据数据源id和字段名称查询
	List<DataCode> findByDataAndName(@Param(value = "feeDataId") String feeDataId, @Param(value = "codeName") String codeName);
	//删除数据源的所有字段
	void deleteByData(@Param(value = "feeDataId") String feeDataId);
//更新表头绑定的fee_order_field值
	public void updateOrderFieldToCode(@Param(value = "feeDataCodeId") String feeDataCodeId, @Param(value = "feeFieldType") String feeFieldType,
                                       @Param(value = "feeOrderFieldId") String feeOrderFieldId);
}